package com.chinaunicom.emergency.model;

import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author liliang
 * @date 2019-12-13
 */
@Entity
@Getter
@Setter
@EqualsAndHashCode
@Table(name = "yjgl_dictionary")
public class Dictionary implements Serializable {
    @Id
    @GeneratedValue(generator="yjglDictionaryUUID")
    @GenericGenerator(name="yjglDictionaryUUID",strategy="uuid")
    private String pid;

    @ApiModelProperty(value="字典编号")
    private String dicCode;

    @ApiModelProperty(value="字典值")
    private String dicValue;

    @ApiModelProperty(value="父级字典id")
    private String parentId;

    @ApiModelProperty(value="描述")
    private String dicDescribe;

    @ApiModelProperty(value="创建人")
    private String createBy;

    @ApiModelProperty(value="创建时间")
    private Date createTime;

    @ApiModelProperty(value="修改人")
    private String updateBy;

    @ApiModelProperty(value="修改时间")
    private Date updateTime;

    @ApiModelProperty(value="软删除")
    private Integer isSoftDel;

    @ApiModelProperty(value="删除人")
    private String deleteBy;

    @ApiModelProperty(value="删除时间")
    private Date deleteTime;

    @Transient
    private List<Dictionary> childs = new ArrayList();

    @Override
    public String toString(){
        return JSONObject.toJSONString(this);
    }
}
